package com.youthburin.rmp.domain;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the rmp_role database table.
 * 
 */
@Entity
@Table(name="rmp_role")
public class RmpRole extends BaseVO implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="CODE")
	private String code;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME")
	private Date createTime;

	@Column(name="CREATER")
	private String creater;

	@Column(name="NAME")
	private String name;

	@Column(name="REMARK")
	private String remark;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="UPDATE_TIME")
	private Date updateTime;

	@Column(name="UPDATER")
	private String updater;

	//bi-directional many-to-many association to RmpPermission
	@ManyToMany(mappedBy="rmpRoles")
	private Set<RmpPermission> rmpPermissions;

	//bi-directional many-to-many association to RmpUser
    @ManyToMany
	@JoinTable(
		name="rmp_user_role"
		, joinColumns={
			@JoinColumn(name="ROLE_CODE")
			}
		, inverseJoinColumns={
			@JoinColumn(name="USER_CODE")
			}
		)
	private Set<RmpUser> rmpUsers;

    public RmpRole() {
    }

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreater() {
		return this.creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUpdater() {
		return this.updater;
	}

	public void setUpdater(String updater) {
		this.updater = updater;
	}

	public Set<RmpPermission> getRmpPermissions() {
		return this.rmpPermissions;
	}

	public void setRmpPermissions(Set<RmpPermission> rmpPermissions) {
		this.rmpPermissions = rmpPermissions;
	}
	
	public Set<RmpUser> getRmpUsers() {
		return this.rmpUsers;
	}

	public void setRmpUsers(Set<RmpUser> rmpUsers) {
		this.rmpUsers = rmpUsers;
	}
	
}